﻿
    //学院
    $(function () {
        $.ajax({
            url: "/SysUserInfo/CollegeList",
            type: "get",
            dataType: "json",
            success: function (obj) {
                $("#College").empty();
                for (var i = 0; i < obj.length; i++) {
                    $("#College").append("<option value='" + obj[i].ID + "'>" + obj[i].College_Name + "</option>");
                }
                changeTie()
            }
        })
    })
//系
function changeTie() {
    $("#Tie").empty();
    var ParentID = $("#College").val();
    $.ajax({
        url: "/SysUserInfo/TieList?ParentID=" + ParentID,
        type: "get",
        //data: { ParentID: ParentID },
        dataType: "json",
        success: function (obj) {
            for (var i = 0; i < obj.length; i++) {
                $("#Tie").append("<option value='" + obj[i].ID + "'>" + obj[i].Tie_Name + "</option>");
            }
            changephasetable();

        }
    })
}
//阶段
function changephasetable() {
    $("#phasetable").empty();
    var ParentID = $("#Tie").val();
    $.ajax({
        url: "/SysUserInfo/PhaseTableList?ParentID=" + ParentID,
        type: "get", 
        dataType: "json",
        success: function (obj) {
            for (var i = 0; i < obj.length; i++) {
                $("#phasetable").append("<option value='" + obj[i].ID + "'>" + obj[i].Phase_Name + "</option>");
            }
        }
    })
}
function sum() {
    //单选数量
    var RadioCount = $("input[name='RadioCount']").val();
    //单选分数
    var RadioScore = $("input[name='RadioScore']").val();
    //多选数量
    var CheckCount = $("input[name='CheckCount']").val();
    //多选分数
    var CheckScore = $("input[name='CheckScore']").val();
    //判断数量
    var JudgeCount = $("input[name='JudgeCount']").val();
    //判断分数
    var JudgeScores = $("input[name='JudgeScores']").val();
    var reault = parseFloat(RadioCount * RadioScore) + parseFloat(CheckCount * CheckScore) + parseFloat(JudgeCount * JudgeScores);
 
    if (parseFloat(reault) <= parseFloat(100))
    {
        $("#submit").removeClass()
        $("#submit").addClass("btn btn-primary radius");
    }
    $("input[name='reault']").val(parseFloat(reault));
}
